// Defines a divisionquestion
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.chalmers.se.tda367.question;

/**
 *
 * @author Hanna
 */
public class DivisionMathQuestion extends MathQuestion {

    public DivisionMathQuestion(int maxX, int maxY) {  // the parameter maxX is the maximum value that an be assigned to x, but the y value is dependent on the x-value
        int x = 1 + (int) (maxX * Math.random());      // randomizes the x-value
        int y = x * (1 + (int) (maxY * Math.random())); // randomizes the y-value and makes sure that the result of the division is an int
        answer = y / x;
        question = y + " / " + x;
    }
}
